<table cellpadding="0" cellspacing="0">
	<tbody>
        <tr>
            <td class="leftside">
           		<?php require_once("menu.php");?>
            </td>
            <td class="rightside">
                <div class="box" style="margin-left:10px; margin-right: 10px; float:left;">
                	<div id='title_menu' class="ui-corner-top">Members Management</div>  
                    <div class="content" style="min-height: 150px;">
                    <?php
                    	$sql = 'SELECT * FROM members';
						$q = $db->select_query($sql);
						
					?>
                      <form action="#" method="post" enctype="multipart/form-data" id="members-form">
                		<table class="list">
                            <thead>
                              <tr align="center">
                                <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);"></td>
                                <td>Username</td>
                                <td>Poster</td>
                                <td>Email</td>
                                <td>Level</td>
                                <td>Status</td>
                                <td>Signup Date</td>
                                <td>Delete</td>
                              </tr>
                            </thead>
                            <tbody>
                           	<?php while($rs = $db->fetch($q)){?>
                              <tr>
                            	<td width="1" style="text-align: center;"><input type="checkbox" name="selected[]" value="<?php echo $rs['username'];?>"></td>
                                <td>
									<?php echo $rs['username'];?>
                             	</td>
                                <td><?php echo $rs['poster_name'];?></td>
                                <td><?php echo $rs['email'];?></td>
                                <td align="center">
                                	<select name="level" id="level" user="<?php echo $rs['username'];?>">
                                    	<option value="1" <?php ($rs['userlevel']==1)? print 'selected="selected"':'';?>>Member</option>
                                        <option value="2" <?php ($rs['userlevel']==2)? print 'selected="selected"':'';?>>Activated</option>
                                        <option value="3" <?php ($rs['userlevel']==3)? print 'selected="selected"':'';?>>Gold</option>
                                        <option value="4" <?php ($rs['userlevel']==4)? print 'selected="selected"':'';?>>VIP</option>
                                    </select>									
                               	</td>
                                <td align="center">
                                	<select name="status" id="status" user="<?php echo $rs['username'];?>">
                                    	<option value="0" <?php ($rs['status']==0)? print 'selected="selected"': '';?>>Pending</option>
                                        <option value="1" <?php ($rs['status']==1)? print 'selected="selected"': '';?>>Active</option>
                                        <option value="2" <?php ($rs['status']==2)? print 'selected="selected"': '';?>>Warning</option>
                                    </select>
                               	</td>
                                <td><?php echo $rs['date_signup'];?></td>
                                <td align="center"><a href="#" user="<?php echo $rs['username'];?>" id="delmember"><img src="images/delete.png" title="Delete this member" /></a></td>
                          	  </tr>
                            <?php }?>
                            </tbody>
                      	</table>
                      </form>
                      
                    </div>
                </div>            
            </td>
        </tr>
   	</tbody>
</table>